// 身份证号验证
const isvalidIDcard = (str) => {
  if (!str) return true
  const reg = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
  return reg.test(str)
}
// 手机号验证
const isvalidPhone = (str) => {
  if (!str) return true
  const reg = /^1[345789]\d{9}$/;
  return reg.test(str)
}
module.exports = {
  isvalidIDcard: isvalidIDcard,
  isvalidPhone: isvalidPhone
}